#!/bin/csh -f

if ( $#argv != 1 ) then
    echo "Usage : $0 file_to_see_last_change_of"
    exit 1
endif

if ( ! -d CVS ) then
    svn diff -rPREV $*
    exit 1
endif

set fil=$1

set currev=`cvs log $fil | grep 'head:' | awk '{print $2}'`
set lastnr=`echo $currev|sed 's/\./ /g'|awk '{print $NF}'`
@ targetnr = $lastnr - 1
set endofline='$'
set prevrev=`echo ${currev}|sed "s/${lastnr}${endofline}/${targetnr}/"`

dvs diff -r$prevrev $fil

